﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace MTO.Library.Domain
{
    [Table("Customers")]
    public class Customer
    {
        public Customer()
        {
            //Orders = new List<Order>();
        }

        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Column("CustomerId")]
        public int CustomerId { get; protected set; }

        [Required]
        [StringLength(255)]
        [Display(Name="Customer_FirstName", ResourceType = typeof(Resources.Entitites))]
        public string FirstName { get; set; }

        [Required]
        [StringLength(255)]
        [Display(Name="Customer_LastName", ResourceType = typeof(Resources.Entitites))]
        public string LastName { get; set; }

        /// <summary>
        /// Address is a component, not a separate entity; i.e., the Customers table will have 
        /// columns for each property of Address
        /// </summary>
        public Address Address { get; set; }

        /// <summary>
        /// one-to-many from Customer to Order
        /// </summary>
        //public virtual IList<Order> Orders { get; protected set; }
    }
}
